using HKB.Common;
using System;
using System.Data;
using System.Web;
namespace HKB.Web
{
	public class Shop_VIPCard
	{
		private Conn conn = null;
		public Shop_VIPCard()
		{
			this.conn = Text.GetComponent<Conn>("conn", HttpContext.Current.CurrentHandler);
		}
		public Shop_VIPCard(Conn _conn)
		{
			this.conn = _conn;
		}
		public DataTable GetSingleVIPCardByID(int CardID)
		{
			return this.conn.GetDataTable("SELECT * FROM HLShop_VIPCard WHERE Card_ID=" + CardID);
		}
		public DataTable GetVIPCardByOwerID(int OwerID)
		{
			return this.conn.GetDataTable("SELECT * FROM HLShop_VIPCard WHERE OwerID=" + OwerID);
		}
		public bool AddVIPCard(int ShopID)
		{
			return true;
		}
		public bool UpdateVIPCard(bool IsUpgrade, int PresentExp1, int presentPoint1, int TransCount1, decimal TransMoney1, int PresentExp2, int presentPoint2, int TransCount2, decimal TransMoney2, int GivePoint1, int GiveDiscount1, decimal GiveMoney1, int GivePoint2, int GiveDiscount2, decimal GiveMoney2, int GivePoint3, int GiveDiscount3, decimal GiveMoney3, int GivePoint4, int GiveDiscount4, decimal GiveMoney4, int GiveExp1, int GiveExp2, int GiveExp3, int GiveExp4, int CardID)
		{
			return true;
		}
		public bool UpdateVIPStatus(int CardID, bool Status)
		{
			return true;
		}
		public DataTable GetVIPCardByShopID(int ShopID)
		{
			return this.conn.GetDataTable("SELECT * FROM HLShop_VIPCard WHERE ShopID=" + ShopID);
		}
		public DataTable GetVIPCardByUserNameShopName(string UserName, string ShopName)
		{
			if (UserName == null)
			{
				UserName = "";
			}
			if (ShopName == null)
			{
				UserName = "";
			}
			IDbDataParameter[] parameters = new IDbDataParameter[]
			{
				this.conn.CreateParameter("@UserName", DbType.String, UserName),
				this.conn.CreateParameter("@ShopName", DbType.String, ShopName)
			};
			return this.conn.GetDataTable("PR_GetVIPCard", parameters);
		}
		public bool DeleteVIPCard(string card_id)
		{
			IDbDataParameter dbDataParameter = this.conn.CreateParameter("@card_id", DbType.Int32, 0);
			int num = 0;
			string[] array = card_id.Split(new char[]
			{
				','
			});
			for (int i = 0; i < array.Length; i++)
			{
				if (array[i].Trim() != "")
				{
					this.conn.Execute("DELETE FROM HLShop_VIPCard WHERE (Card_ID = @card_id)", new IDbDataParameter[]
					{
						dbDataParameter
					});
					num++;
				}
			}
			return num > 0;
		}
	}
}
